﻿using System.Linq;
using SilenthinkContract.Domain;

namespace Web.Areas.My.Models
{
    public static class IntegralControllerModel
    {
        public class Index
        {
            public decimal AvailablePoint
            {
                get
                {
                    return PointDetails.Any() ? PointDetails.Where( o=>o.Category==IntegralCategory.Increase&& o.Status == IntegralStatus.Normal).Sum(o=>o.Point) : 0;
                }
            }
            public IPagedList<UserIntegral> PointDetails { get; set; }
        }
    }
}